#include "Signal.h"

namespace Core
{
	rtSignal::rtSignal(bool manualReset)
	{
		m_Handle = CreateEvent(NULL, manualReset, false, NULL);
	}

	rtSignal::~rtSignal(void)
	{
		CloseHandle(m_Handle);
	}

	void rtSignal::raise()
	{
		SetEvent(m_Handle);
	}

	void rtSignal::clear()
	{
		ResetEvent(m_Handle);
	}

	bool rtSignal::wait(int timeout)
	{
		DWORD result = WaitForSingleObject(m_Handle, timeout);
		return (result == WAIT_OBJECT_0);
	}

	rtSignal::rtSignal(const rtSignal& )
	{

	}

	rtSignal& rtSignal::operator = (const rtSignal&)
	{
		return *this;
	}
}

